package com.tree.mybatisplus.user.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tree.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 *
 * </p>
 *
 * @author tree
 * @since 2019-05-28
 */
@Data
@Accessors(chain = true)
@KeySequence("id")
@TableName("user")
public class User extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 姓名
     */
    @ApiModelProperty(value = "用户名")
    @NotNull
    @Size(max = 20, message = "输入的字符已达最大长度20")
    private String name;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    @Size(max = 100, min = 0, message = "年龄范围在0-100岁")
    private Integer age;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    @Email
    private String email;




}
